#include "requestfactory.h"

RequestFactory::RequestFactory(QString enc) : CodecFactory()
{
    m_encStr = enc;
    m_info = NULL;
}

RequestFactory::RequestFactory(RequestInfo *info) : CodecFactory()
{
    m_info = info;
    m_encStr = QString();
}

RequestFactory::~RequestFactory()
{

}

Codec *RequestFactory::createCodec()
{
    Codec* codec = NULL;
    if(m_info)
    {
        codec = new RequestCodec(m_info);
    }
    else
    {
        codec = new RequestCodec(m_encStr);
    }
    return codec;
}
